# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgbase=intel-metee
pkgname=(intel-metee intel-metee-doc)
pkgver=3.1.5
pkgrel=1
pkgdesc="Access library for Intel CSME HECI interface"
arch=(loong64 x86_64)
url="https://github.com/intel/metee/"
license=(Apache)
makedepends=(cmake doxygen)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('1085ee44afa7a63d8510a499d6d8bddc56b823025a89fa53c5151b1f3d1a0859')

build() {
  cmake -B build -S metee-${pkgver} \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -Wno-dev
  make -C build
}

package_intel-metee() {
  depends=(glibc)
  
  make -C build DESTDIR="${pkgdir}" install
  mv "${pkgdir}"/usr/share/doc .
}

package_intel-metee-doc() {
  pkgdesc+=' (documentation)'
    
  install -dm755 "${pkgdir}"/usr/share
  mv doc "${pkgdir}"/usr/share
}
